﻿<Page x:Class="PFC.Program.Profile.Pages.ExpensePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:PFC.Program.Profile.Pages"
      xmlns:n="clr-namespace:PFC.CustomControls"
      mc:Ignorable="d" 
      d:DesignHeight="400" 
      d:DesignWidth="800"
      Title="ExpensePage">

    <Grid Background="#FFFF8000">

        <Grid.RowDefinitions>
            <RowDefinition Height="270"/>
            <RowDefinition Height="100"/>
        </Grid.RowDefinitions>

        <!--Контейнер с элементами-->
        <GroupBox Header="| Трата |"
                  Grid.Row="0"
                  Style="{DynamicResource GroupBoxStyle}"
                  Foreground="White"
                  Width="175"
                  Height="235"
                  HorizontalAlignment="Center"
                  VerticalAlignment="Top"
                  Margin="0 30 0 0"
                  FontSize="16">

            <Grid>

                <!--Сетка для элементов в GroupBox-->
                <Grid.RowDefinitions>
                    <RowDefinition Height="70"/>
                    <RowDefinition Height="70"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <!--Категория-->
                <TextBlock Grid.Row="0"
                           HorizontalAlignment="Left"   
                           Text="Категория"
                           FontSize="15"
                           VerticalAlignment="Top"
                           Background="Gray"
                           Padding="3"
                           Foreground="White"
                           Margin="12,7,0,0"/>

                <ComboBox Name="category_Cbx"
                          Grid.Row="0"
                          TabIndex="0"
                          VerticalContentAlignment="Center"
                          BorderThickness="2"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Top"
                          Margin="0,31,0,0"
                          Width="139" Height="29"/>

                <!--Сумма-->
                <TextBlock Grid.Row="1"
                           HorizontalAlignment="Left"   
                           Text="Сумма" 
                           Foreground="White"
                           Background="Gray"
                           Padding="3"
                           FontSize="15"
                           VerticalAlignment="Top" 
                           Margin="12,8,0,0"/>

                <TextBox Name="sum_Txb"
                         Grid.Row="1"
                         TabIndex="1"
                         MaxLength="50"
                         VerticalContentAlignment="Center"
                         HorizontalAlignment="Center"
                         VerticalAlignment="Top"
                         Margin="0,32,0,0"
                         Width="139"
                         KeyDown="sum_Txb_KeyDown" 
                         Height="25">
                    
                    <TextBox.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="0 5 5 5"/>
                        </Style>
                    </TextBox.Resources>
                    
                </TextBox>

                <!--Описание-->
                <TextBlock Grid.Row="2"
                           HorizontalAlignment="Left"   
                           Text="Описание" 
                           Foreground="White"
                           Background="Gray"
                           Padding="3"
                           FontSize="15"
                           VerticalAlignment="Top" 
                           Margin="12,8,0,0"/>

                <TextBox Name="desc_Txb"
                         Grid.Row="2"
                         TabIndex="2"
                         MaxLength="30"
                         VerticalContentAlignment="Center"
                         Margin="12,32,11,0"
                         Height="25"
                         VerticalAlignment="Top">

                    <TextBox.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="0 5 5 5"/>
                        </Style>
                    </TextBox.Resources>

                </TextBox>

                <WrapPanel Name="AddNewCategory"
                           ButtonBase.Click="AddNewCategory_Click">
                    <n:NavButton ImageSource="/Resources/add.png"
                                 Width="25"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Top"
                                 Margin="82,7,0,0"
                                 NavUri="/Program/Profile/Pages/CategoriesPage.xaml"/>
                </WrapPanel>

            </Grid>

        </GroupBox>

        <!--Кнопки для выхода и создания транизакции-->
        <WrapPanel Orientation="Horizontal"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Top"
                   Grid.Row="1"
                   Margin="5 0 0 0">

            <Button Name="back_Btn"
                    Style="{DynamicResource ButtonStyle}"
                    TabIndex="4"
                    Width="80"
                    Height="35"
                    Content="Назад"
                    Margin="0 0 10 0"
                    Click="back_Btn_Click"/>

            <Button Name="createTransaction_Btn"
                    Style="{DynamicResource ButtonStyle}"
                    TabIndex="3"
                    Width="80"
                    Height="35"
                    Content="Потратить"
                    Click="createTransaction_Btn_Click"/>
        </WrapPanel>

    </Grid>
</Page>
